package org.raymond.iworks.study.netty.official.fundamental.time2;

import java.time.Instant;

/**
 * @author raymond
 * @version V1.0
 * @Description: TODO
 */
public class UnixTime {
    private final long value;

    public UnixTime() {
        this(System.currentTimeMillis() / 1000L + 2208988800L);
    }

    public UnixTime(long value) {
        this.value = value;
    }

    public long value() {
        return value;
    }

    @Override
    public String toString() {
        return Instant.ofEpochMilli((value() - 2208988800L) * 1000L).toString();
    }
}
